 |
|
 |
Subject: Xpage getDatabase - doesn't get the database |
 |
 |
 |
Product Area: Other |
 |
Technical Area: Application Development |
 |
Platform: Windows |
 |
Release: 8.5.1 |
 |
Reproducible: Always |
 |
 |
 |
 |
Hello
Starting with my first XPages attempt and have run issues.
I have two views and one button. One viewpanel is in the current database, another is in a different database.
The one button should set the same flag across two databases.
If I use
whichDB=database for the current database, my updates work.
If I use getDatabase method with server and fileanme then it doesn't.
I can of course use database for the current database but I used the getDatabase to see if it was something like an access problem in the external database but it can't be if
whichDB = database works but the server name and file path do not for the current database.
I have tried
- hardwiring the server name and path
- putting !! in front of database name
and I really just do not know why it is not working.
The code for my button is below.
I would really appreciate any guidance!
Thanks in advance
Kathy
<xp:button value="New Button" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="partial">
<xp:this.action><![CDATA[#{javascript:
var docServer = @Name("[CN]", Subset(@DbName(), 1));
print(@Name("CN]",@Subset(@DbName(),1))) for (v=1;v<3;v++){
var viewPanel=getComponent("viewPanel" + v );
var whichDB:NotesDatabase
if (v == 1){
whichDB=session.getDatabase(@Name("CN]",@Subset(@DbName(),1)), "prod\events.nsf");
}
else{
whichDB=session.getDatabase(@Name("CN]",@Subset(@DbName(),1)), "prod\diary.nsf");
}
print ("title = "+ whichDB.getTitle())
var docIDs=@Explode(viewPanel.getSelectedIds());
for(i=0 ; i < docIDs.length ; i++){
var docId = docIDs[i];
var doc:NotesDocument = whichDB.getDocumentByID(docId);
doc.replaceItemValue("Publish", "");
doc.save(true, false)}}}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
 
Feedback number WEBB8B89TG created by ~Naomi Bubkrovernivu on 11/15/2010

Status: Open
Comments:

Xpage getDatabase - doesn't get the... (~Naomi Bubkrove... 15.Nov.10)
. . Escape character (~Tip Kinizenniv... 15.Nov.10)
. . . . That was it! (~Naomi Bubkrove... 17.Nov.10) |
|  |
|